package com.ccc.dingtalk.mapper;

import com.ccc.dingtalk.pojo.db.UserInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author superC
 * @version 2.0.0
 * @date 2023/8/24
 */

@Mapper
public interface UserInfoMapper {

    @Select(value = "select * from user")
    List<UserInfo> findAll();

    @Insert("INSERT INTO user(id, name) VALUES(#{id}, #{name})")
    void insert(UserInfo entity);

    @Delete("DELETE FROM user WHERE id = #{id}")
    void delete(String id);

    @Delete("DELETE FROM user")
    void truncate();

}
